package com.huffman.smart_picture.domain.request.space;

import com.huffman.smart_picture.domain.entity.Space;
import lombok.Data;

import java.io.Serializable;

@Data
public class SpaceUpdateRequest implements Serializable {

    /**
     * id
     */
    private Long id;

    /**
     * 空间名称
     */
    private String spaceName;

    /**
     * 空间级别：0-普通版 1-专业版 2-旗舰版
     */
    private Integer spaceLevel;

    /**
     * 空间图片的最大总大小
     */
    private Long maxSize;

    /**
     * 空间图片的最大数量
     */
    private Long maxCount;

    private static final long serialVersionUID = 1L;


    public static Space convert(SpaceUpdateRequest spaceUpdateRequest) {
        Space space = new Space();
        Long id = spaceUpdateRequest.getId();
        String spaceName = spaceUpdateRequest.getSpaceName();
        Integer spaceLevel = spaceUpdateRequest.getSpaceLevel();
        Long maxSize = spaceUpdateRequest.getMaxSize();
        Long maxCount = spaceUpdateRequest.getMaxCount();
        space.setId(id);
        space.setSpaceName(spaceName);
        space.setSpaceLevel(spaceLevel);
        space.setMaxSize(maxSize);
        space.setMaxCount(maxCount);
        return space;
    }
}
